<template>
<view>
<view class="singin_code">
	<view class="singin_codeheader">
		请输入活动编码
	</view>
	<!-- <u-message-input maxlength="5" value="46821"></u-message-input> -->
	<!-- <view style="color:#ff00ff">{{message}}</view> -->
			<view class="code-input-main">
				<view class="inputLine">
					<input class="input-item" maxlength="1" :value="code[0]"></input>
					<input class="input-item" maxlength="1" :value="code[1]"></input>
					<input class="input-item" maxlength="1" :value="code[2]"></input>
				<!-- </view>
				<view class="inputLine"> -->
	 
					<input class="input-item" maxlength="1" :value="code[3]"></input>
					<input class="input-item" maxlength="1" :value="code[4]"></input>
					<input class="input-item" maxlength="1" :value="code[5]"></input>
				</view>
	 
	 
				<input @input="inputEvent" class="code-input-input" v-model="code" maxlength="6" type="number" />
			</view>
	<view class="singin_codebox">
	<!-- <u-message-input maxlength="6" value="46821"></u-message-input> -->
	</view>
</view>
</view>
</template>

<script module="tools" lang="wxs" src="../../utils/tools.wxs"></script>

<script>
import {sigin} from '@/api/sigin.js';
var t = require("../../utils/request.js"),
    e = function (t) {
  return t && t.__esModule ? t : {
    default: t
  };
}(require("../../utils/api.js")),
    a = require("../../utils/util.js"),
    n = e.default.departmentDetail,
    o = e.default.departmentJoin,
	joiedOrgList = e.default.departmantOrgList,
    i = e.default.departmentDeleteJoin,
    s = e.default.departmentCancelJoin,
    c = e.default.departmentQuit,
    l = e.default.messageList,
    app = getApp();

export default {
  data() {
    return {
	  code:'',
    };
  },
  methods: {
	  inputEvent(res){
	  				console.log( res.detail.value);
	  				/* this.$emit('vueMsg',res.detail.value); */
	  				 if(res.detail.value.length==6){
						 let data={}
						 sigin(data).then((result => {
						 	console.log(result)
						 	if (result.success) {
						 		uni.showToast({
						 			title: "签到成功",
						 			icon: "success",
						 			duration: 2000
						 		})
						 		setTimeout(function() {
						 			uni.navigateTo({
						 				url: "/pages/index/index",
						 
						 			});
						 		}, 1000);
						 	} else {
						 		uni.showToast({
						 			title: result.message,
						 			icon: "none",
						 			duration: 2000
						 		})
						 	}
						 }));
	  				 }
	  			},
	 
   
  }
};
</script>
<style>
.singin_code{
	    position: relative;
	    z-index: 50;
	    height: 100vh;
	    background: rgba(239, 239, 239, 0.9);
		padding: 60rpx 10rpx;
}
.singin_codeheader{
	    padding: 30rpx 0 0;
	    text-align: center;
	    color: #333333;
	    font-size: 40rpx;
	    font-weight: bold;
}
.singin_codebox{
	padding: 50rpx 10rpx;
	margin-top: 30rpx;
}
.singin_codebox input{
	border-bottom: 1rpx dashed #E3E3E3;
    /* letter-spacing: 80rpx; */
	font-size: 50rpx;
	display: inline-flex;
	margin: 0 10px ;
	/* padding-left: 50rpx; */
	width: 10%;
	text-align: center;
}
.no_dialog {
    width: 100%;
    height: 100rpx;
    background: #f4f4f4;
    line-height: 100rpx;
    text-align: center;
    font-size: 24rpx;
    color: #b4b4b4;
}
	.code-input-input {
		height: 400upx;
		position: absolute;
		width: 100%;
		outline: none;
		color: transparent;
		text-shadow: 0 0 0 transparent;
		width: 300%;
		margin-left: -100%;
		background: #00000000;
	}
 
	.code-input-main {
		display: flex;
		/* flex-direction: column; */
		width: 100%;
		height: 400upx;
	}
 
	.input-item {
		width: 250upx;
		height: 110upx;
		font-size: 40upx;
		/* background: #000000; */
		text-align: center;
		border-radius: 5%;
		margin-left: 40upx;
		margin-right: 40upx;
		color: #24cba9;
		border-bottom: 1rpx solid #777878;
	}
 
	.inputLine {
		display: flex;
		justify-content: center;
		width: 100%;
		margin-top: 80upx;
	}
</style>